@extends('layouts.admin')
@section('title') @parent 订单 - {{ $node->name }}  @stop
@section('page_title')@parent
订单 - {{ $node->name }}
@show
@section('breadcrumb')@parent
{{ Breadcrumbs::render('order-update') }}
@show
@section('content')

<div class="row">
    <div class="col-xs-8">
				<div class="box">
						<div class="box-header">
								<h3 class="box-title">订单信息</h3>
						</div><!-- /.box-header -->
						<div class="box-body">
								<table class="table table-bordered">
										<tbody>
											<tr>
													<th>订单号</th>
													<td>{{ $order->order_no }}</td>
													<th>订单状态</th>
													<td>{{ $order->workflow()->node->display_name }}</td>
											</tr>
											<tr>
													<th>买家</th>
													<td>{{ $order->user->realname() }}@if($order->phone)（{{ $order->phone }}）@endif</td>
													<th>下单时间</th>
													<td>{{ $order->created_at }}</td>
											</tr>
											<tr>
													<th>下单时间</th>
													<td>{{ $order->created_at }}</td>
													<th>更新时间</th>
													<td>{{ $order->updated_at }}</td>
											</tr>
										
							</tbody></table>
						</div><!-- /.box-body -->
				</div>
				<div class="box">
						<div class="box-header">
								<h3 class="box-title">商品详情</h3>
						</div><!-- /.box-header -->
						<div class="box-body">
								<table class="table table-bordered">
										<tbody>
											<tr>
													<th>商品名称</th>
													<th>商品图片</th>
													<th>数量</th>
													<th>单价</th>
													<th>小计</th>
											</tr>
											@foreach ($order->items as $item)
											<tr>
												<td>{{ $item->product->name }}</td>
												<td><img src="{{ url($item->product->thumb) }}" class="pro_img"></td>
												<td>{{ $item->qty }}</td>
												<td>{{ $item->price }}</td>
												<td>{{ $item->subtotal() }}</td>
											</tr>
											@endforeach
											<tr>
											<tr>
												<td></td>
												<td></td>
												<td></td>
												<td>总价</td>
												<td>{{ $order->price }}</td>
											</tr>												
											</tr>
								</tbody></table>
						</div><!-- /.box-body -->
				</div>
				<div class="box">
								<form fole="form" method="post" action="{{ route('admin.order.update', ['id'=>$order->id, 'step'=>$node->id ]) }}" >
								<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">			
				   <div class="box-header">
						<h3 class="box-title">{{ $node->name }}</h3>
					</div><!-- /.box-header -->         
					<div class="box-body">
										<table width="100%" style="border:1px #EEE solid;" cellspacing="2" cellpadding="3">
											<tr>
													<th>订单处理</th>
													<td>{{ $node->name }}</td>	
											</tr>
											<tr>
													<th>备注</th>
													<td><textarea class="control" cols="50" name="memo"></textarea></td>	
											</tr>
										</table>
								</div>
								<div class="box-footer">
										<button class="btn btn-primary" type="submit">保存</button>
								</div>	
					</form>
				</div><!-- /.box -->
    </div>
		<div class="col-xs-4">
				<!-- The time line -->
				<ul class="timeline">
						<!-- timeline time label -->
						@foreach ($workflows as $work)
						<li>
							 @if($work->workflow_node_id==3)
							 <!-- 发货 -->
							 <i class="fa fa-bell bg-yellow"></i>
							 @elseif($work->workflow_node_id==6)
							 <!-- 取消 -->
							 <i class="fa fa-bell bg-navy"></i>
							 @elseif($work->workflow_node_id==7)
							 <!-- 删除-->
							 <i class="fa fa-bell bg-red"></i>
							 @elseif($work->workflow_node_id==8)
							 <!-- 付款-->
							 <i class="fa fa-cny bg-lime"></i>
							 @elseif($work->workflow_node_id==5)
							 <!-- 完成-->
							 <i class="fa fa-check-square-o bg-green"></i>
							 @else
							 <i class="fa fa-bell bg-aqua"></i>
							 @endif
							 <div class="timeline-item">
										<span class="time"><i class="fa fa-clock-o"></i> {{ friendly_date($work->updated_at) }}</span>
										<h3 class="timeline-header"><a href="#">{{ $work->user_name }}</a> {{ $work->node->name }}</h3>
										<div class="timeline-body">           
											 {{ $work->memo }}
										</div>
							 </div> 
						</li>
						@endforeach
						<li>
								 <i class="fa fa-clock-o"></i>
						</li>
				</ul>
		</div>
</div>


@stop

@section('end')
    @parent

@stop